{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1485,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 首先 import 必要的模块\n",
    "import pandas as pd \n",
    "import numpy as np\n",
    "\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "\n",
    "#竞赛的评价指标为logloss\n",
    "from sklearn.metrics import log_loss  \n",
    "\n",
    "from sklearn.svm import LinearSVC\n",
    "\n",
    "from matplotlib import pyplot\n",
    "import seaborn as sns\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1486,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "      <th>Outcome</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "      <td>148</td>\n",
       "      <td>72</td>\n",
       "      <td>35</td>\n",
       "      <td>0</td>\n",
       "      <td>33.6</td>\n",
       "      <td>0.627</td>\n",
       "      <td>50</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>85</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>0</td>\n",
       "      <td>26.6</td>\n",
       "      <td>0.351</td>\n",
       "      <td>31</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>8</td>\n",
       "      <td>183</td>\n",
       "      <td>64</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>23.3</td>\n",
       "      <td>0.672</td>\n",
       "      <td>32</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>89</td>\n",
       "      <td>66</td>\n",
       "      <td>23</td>\n",
       "      <td>94</td>\n",
       "      <td>28.1</td>\n",
       "      <td>0.167</td>\n",
       "      <td>21</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>137</td>\n",
       "      <td>40</td>\n",
       "      <td>35</td>\n",
       "      <td>168</td>\n",
       "      <td>43.1</td>\n",
       "      <td>2.288</td>\n",
       "      <td>33</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Pregnancies  Glucose  BloodPressure  SkinThickness  Insulin   BMI  \\\n",
       "0            6      148             72             35        0  33.6   \n",
       "1            1       85             66             29        0  26.6   \n",
       "2            8      183             64              0        0  23.3   \n",
       "3            1       89             66             23       94  28.1   \n",
       "4            0      137             40             35      168  43.1   \n",
       "\n",
       "   DiabetesPedigreeFunction  Age  Outcome  \n",
       "0                     0.627   50        1  \n",
       "1                     0.351   31        0  \n",
       "2                     0.672   32        1  \n",
       "3                     0.167   21        0  \n",
       "4                     2.288   33        1  "
      ]
     },
     "execution_count": 1486,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dpath = ''\n",
    "train = pd.read_csv(dpath +\"diabetes.csv\")\n",
    "train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1487,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 768 entries, 0 to 767\n",
      "Data columns (total 9 columns):\n",
      "Pregnancies                 768 non-null int64\n",
      "Glucose                     768 non-null int64\n",
      "BloodPressure               768 non-null int64\n",
      "SkinThickness               768 non-null int64\n",
      "Insulin                     768 non-null int64\n",
      "BMI                         768 non-null float64\n",
      "DiabetesPedigreeFunction    768 non-null float64\n",
      "Age                         768 non-null int64\n",
      "Outcome                     768 non-null int64\n",
      "dtypes: float64(2), int64(7)\n",
      "memory usage: 54.1 KB\n"
     ]
    }
   ],
   "source": [
    "train.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1488,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "      <th>Outcome</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>3.845052</td>\n",
       "      <td>120.894531</td>\n",
       "      <td>69.105469</td>\n",
       "      <td>20.536458</td>\n",
       "      <td>79.799479</td>\n",
       "      <td>31.992578</td>\n",
       "      <td>0.471876</td>\n",
       "      <td>33.240885</td>\n",
       "      <td>0.348958</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.369578</td>\n",
       "      <td>31.972618</td>\n",
       "      <td>19.355807</td>\n",
       "      <td>15.952218</td>\n",
       "      <td>115.244002</td>\n",
       "      <td>7.884160</td>\n",
       "      <td>0.331329</td>\n",
       "      <td>11.760232</td>\n",
       "      <td>0.476951</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.078000</td>\n",
       "      <td>21.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>62.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>27.300000</td>\n",
       "      <td>0.243750</td>\n",
       "      <td>24.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>3.000000</td>\n",
       "      <td>117.000000</td>\n",
       "      <td>72.000000</td>\n",
       "      <td>23.000000</td>\n",
       "      <td>30.500000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>0.372500</td>\n",
       "      <td>29.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>6.000000</td>\n",
       "      <td>140.250000</td>\n",
       "      <td>80.000000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>127.250000</td>\n",
       "      <td>36.600000</td>\n",
       "      <td>0.626250</td>\n",
       "      <td>41.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>17.000000</td>\n",
       "      <td>199.000000</td>\n",
       "      <td>122.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>846.000000</td>\n",
       "      <td>67.100000</td>\n",
       "      <td>2.420000</td>\n",
       "      <td>81.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Pregnancies     Glucose  BloodPressure  SkinThickness     Insulin  \\\n",
       "count   768.000000  768.000000     768.000000     768.000000  768.000000   \n",
       "mean      3.845052  120.894531      69.105469      20.536458   79.799479   \n",
       "std       3.369578   31.972618      19.355807      15.952218  115.244002   \n",
       "min       0.000000    0.000000       0.000000       0.000000    0.000000   \n",
       "25%       1.000000   99.000000      62.000000       0.000000    0.000000   \n",
       "50%       3.000000  117.000000      72.000000      23.000000   30.500000   \n",
       "75%       6.000000  140.250000      80.000000      32.000000  127.250000   \n",
       "max      17.000000  199.000000     122.000000      99.000000  846.000000   \n",
       "\n",
       "              BMI  DiabetesPedigreeFunction         Age     Outcome  \n",
       "count  768.000000                768.000000  768.000000  768.000000  \n",
       "mean    31.992578                  0.471876   33.240885    0.348958  \n",
       "std      7.884160                  0.331329   11.760232    0.476951  \n",
       "min      0.000000                  0.078000   21.000000    0.000000  \n",
       "25%     27.300000                  0.243750   24.000000    0.000000  \n",
       "50%     32.000000                  0.372500   29.000000    0.000000  \n",
       "75%     36.600000                  0.626250   41.000000    1.000000  \n",
       "max     67.100000                  2.420000   81.000000    1.000000  "
      ]
     },
     "execution_count": 1488,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "## 各属性的统计特性\n",
    "train.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1489,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEKCAYAAAAIO8L1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAEvZJREFUeJzt3XuwZWV95vHvYyOgiYLQR0K6mzTBziRkQry0hBSWErAsdZxAjBitKK10TU8SE3VyMZiaUWNlEgzxksuMMyQgjeWNUhlagxcGaM1FgQa5CRo6DIEWpBu5qGNEkd/8sd4et4e3++wDvc8+zfl+qnbt9b7rXWv/9umu/ex12WulqpAkabbHTLsASdLiZEBIkroMCElSlwEhSeoyICRJXQaEJKnLgJAkdRkQkqQuA0KS1LXPtAt4JJYvX16rV6+edhmStFe58sor76qqmbnG7dUBsXr1arZs2TLtMiRpr5LkX8YZ5y4mSVKXASFJ6jIgJEldBoQkqcuAkCR1TTQgktyS5LokVyfZ0voOSnJRkpva85Naf5L8RZKtSa5N8vRJ1iZJ2r2F2IL4hap6alWtbe3TgIurag1wcWsDvABY0x4bgHcvQG2SpF2Yxi6mE4GNbXojcNJI/7k1+DxwYJJDp1CfJInJB0QBn05yZZINre+QqroDoD0/ufWvAG4bWXZb65MkTcGkf0l9bFXdnuTJwEVJvrSbsen01UMGDUGzAeCwww57xAU+4/fOfcTr0KPPlWecMu0SpKmb6BZEVd3enrcD5wNHA3fu3HXUnre34duAVSOLrwRu76zzzKpaW1VrZ2bmvJSIJOlhmlhAJPmhJE/YOQ08D7ge2ASsa8PWARe06U3AKe1spmOA+3buipIkLbxJ7mI6BDg/yc7XeX9VfTLJFcB5SdYDtwInt/EXAi8EtgLfAl49wdokSXOYWEBU1c3Az3b6vwac0Okv4DWTqkeSND/+klqS1GVASJK6DAhJUpcBIUnqMiAkS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etWkvY0Bo2t7OsE98p79m+FC+HPg5dv3tfne+zPBB/gng19qum78BbgCuSnI98D+ZYwu67c56I3ApcA1wVVVdMMdrnw9c28ZfwnC84KtV9UmGy6hvSXI1w3EXgFcCr01yLcMxgh+pqtsYgvNa4H3AF+bx3l8LrG0HnW8Afm2O9/hF4L8Cn0lyDfCOOdbz+nYA/hqGXYOfmEdt2st4NVdJUpdbEJKkLgNCktRlQEiSugwISVKXASFJ6jIgJEldBoQkqcuAkCR1/T9XjF1drtKrTgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Target 分布，看看各类样本分布是否均衡\n",
    "#各类样本分布不太均衡\n",
    "sns.countplot(train.Outcome);\n",
    "pyplot.ylabel('Outcome');\n",
    "pyplot.xlabel('Number of occurrences');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1490,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(614, 8)"
      ]
     },
     "execution_count": 1490,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Y_train = train['Outcome'].values\n",
    "train = train.drop([ 'Outcome'], axis=1)\n",
    "X_train = np.array(train)\n",
    "# X_train.shape#(768, 8)\n",
    "Y_train.shape#(768,)\n",
    "\n",
    "X_train, X_test, Y_train, Y_test = train_test_split(X_train, Y_train, random_state=22, test_size=0.2)\n",
    "X_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1491,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 数据标准化\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "\n",
    "# 初始化特征的标准化器\n",
    "ss_X = StandardScaler()\n",
    "\n",
    "# 分别对训练和测试数据的特征进行标准化处理\n",
    "X_train = ss_X.fit_transform(X_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    ">default Logistic Regression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1492,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logloss of each fold is:  [0.43565553 0.47492891 0.40525837 0.57083939 0.51008158]\n",
      "cv logloss is: 0.47935275527586063\n"
     ]
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "lr= LogisticRegression()\n",
    "# 交叉验证用于评估模型性能和进行参数调优（模型选择）\n",
    "#分类任务中交叉验证缺省是采用StratifiedKFold\n",
    "from sklearn.cross_validation import cross_val_score\n",
    "loss = cross_val_score(lr, X_train, Y_train, cv=5, scoring='neg_log_loss')\n",
    "print 'logloss of each fold is: ',-loss\n",
    "print'cv logloss is:', -loss.mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "下面是正则化的 Logistic Regression及参数调优"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1493,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=5, error_score='raise',\n",
       "       estimator=LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, max_iter=100, multi_class='ovr', n_jobs=1,\n",
       "          penalty='l2', random_state=None, solver='liblinear', tol=0.0001,\n",
       "          verbose=0, warm_start=False),\n",
       "       fit_params=None, iid=True, n_jobs=1,\n",
       "       param_grid={'penalty': ['l1', 'l2'], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]},\n",
       "       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n",
       "       scoring='neg_log_loss', verbose=0)"
      ]
     },
     "execution_count": 1493,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#logistic回归的需要调整超参数有：C（正则系数，一般在log域（取log后的值）均匀设置候选参数）和正则函数penalty（L2/L1）\n",
    "#目标函数为：J = sum(logloss(f(xi), yi)) + C* penalty\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "\n",
    "#需要调优的参数\n",
    "# 请尝试将L1正则和L2正则分开，并配合合适的优化求解算法（slover）\n",
    "#tuned_parameters = {'penalty':['l1','l2'],\n",
    "#                   'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "#                   }\n",
    "penaltys = ['l1','l2']\n",
    "Cs = [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "tuned_parameters = dict(penalty = penaltys, C = Cs)\n",
    "\n",
    "lr_penalty= LogisticRegression()\n",
    "grid= GridSearchCV(lr_penalty, tuned_parameters,cv=5, scoring='neg_log_loss')\n",
    "grid.fit(X_train,Y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1494,
   "metadata": {},
   "outputs": [],
   "source": [
    "# view the complete results (list of named tuples)\n",
    "#grid.cv_results_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1495,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.4789945013254119\n",
      "{'penalty': 'l1', 'C': 1}\n"
     ]
    }
   ],
   "source": [
    "# examine the best model\n",
    "print(-grid.best_score_)\n",
    "print(grid.best_params_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1496,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZQAAAEKCAYAAAA1qaOTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xl8VOX1+PHPmclK2BKWsISwCcq+hR3cUEFrEVTQKm6t+ivq17a2KoJacStI3VpbRVBE0aIGUdwVFEFUEBBI2JE1ISEhkITsmZnn98dMIMAEJslM7iQ5b1/zmrs8d+bcIDk897n3PGKMQSmllKoum9UBKKWUqhs0oSillPILTShKKaX8QhOKUkopv9CEopRSyi80oSillPILTShKKaX8QhOKUkopv9CEopRSyi9CrA6gJjVv3tx06NDB6jCUUqpWWbdu3WFjTIuztatXCaVDhw6sXbvW6jCUUqpWEZF9vrTTS15KKaX8QhOKUkopv9CEopRSyi/q1RiKN6WlpaSkpFBUVGR1KEErIiKCuLg4QkNDrQ5FKRXE6n1CSUlJoVGjRnTo0AERsTqcoGOMISsri5SUFDp27Gh1OEqpIFbvL3kVFRXRrFkzTSYVEBGaNWumPTil1FnV+4QCaDI5C/35KKV8oQmlCq6b/SPXzf7R6jCUUiqoaEIJAg0bNjy+PGbMGJo2bcqVV17pte3dd99N37596d69O5GRkfTt25e+ffuSmJhYqe9cv349X3zxRbXiVupUg+ddw+B511gdhl/UlXOpyfOo94Pyweb++++noKCA2bNne93/n//8B4C9e/dy5ZVXsmHDhip9z/r160lOTmbMmDFVjlX5x21f3AbAvDHzLI5EqerRHkqQGTVqFI0aNarSsTt37mT06NEMGDCA888/nx07dgCwcOFCevbsSZ8+fbjooosoLCzk8ccf5+23365S70b515a0XLak5VodhlLVpj2UcqZ/vJktB8/+F7vsL78v4yjd2zTm77/tUe3YfHHnnXcyd+5cOnfuzKpVq7jnnnv46quvmD59OsuXLyc2Npbs7GwiIyN59NFHSU5O5oUXXqiR2JRSdZ8mlDoiOzubn376iWuuOXGt1OFwADB8+HBuvvlmJkyYwNVXX21ViEqpOk4TSjm+9iTKeibv/r+hgQynUowxNG/e3OuYypw5c1i9ejWffPIJffr0YdOmTRZEqJSq63QMpY6Ijo6mdevWLF68GACXy8XGjRsB2L17N0OGDOGJJ54gOjqa1NRUGjVqxLFjx6wMWSlVx2hCCTIjR45kwoQJLFu2jLi4OL788kufj124cCGvvPIKffr0oUePHnzyyScA/OUvf6FXr1706tWLSy65hJ49e3LxxRezceNG+vXrp4PySim/0EteQSAvL+/48sqVK306pkOHDiQnJ5+0rVOnTl4T0JIlS07b1qJFC51sTCnlV5pQqiCYxk6UUipY6CUvVSvd9sVtxx8IVEoFB00oSiml/EITilJKK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5/MMZki8hyYAwQkBsntIdSCSLSpdzqWGCbVbFUl4iMwT0NwFhjTIHV8dRjPwNdRKSjiIThnu56icUx1WuegezXgK3GmOesjqc6RKRF2R2cIhIJXEIAf2/pXV6VICKLgHNx31W0D/ijMSbV2qiqxjOXTDiQ5dn0U228Y01ExgP/BloA2cAGY8xoa6OqHBG5AngBsAOvG2OesjikKhGR/wEX4q5sewj4uzGm1s1VJCIjgJVAEu6/6wBTjTGfWRdV1YhIb2A+7v+3bMB7xpjHA/Z9mlCUUkr5g17yUkop5ReaUJRSSvmFJhSllFJ+oQlFKaWUX2hCUUop5ReaUJTyIxHJO3urMx6fKCKdPMsNRWS2iPzqqRS7QkQGi0iYZ1kfTFZBRROKUkFCRHoAdmPMbs+mubiLLXYxxvQAbgWae4pILgOusyRQpSqgCUWpABC3WZ6aY0kicp1nu01E/uvpcXwiIp+JyLWew24EPvK06wwMBh42xrgAPBWJP/W0/dDTXqmgoV1mpQLjaqAv0Af3k+M/i8gKYDjQAegFtMRdGv11zzHDgf95lnvgfurfWcHnJwMDAxK5UlWkPRSlAmME8D9PpddDwHe4E8AI4H1jjMsYkw58W+6Y1kCmLx/uSTQlngmglAoKmlCUCgxvZenPtB2gEIjwLG8G+ojImf6OhgNFVYhNqYDQhKJUYKwArvNMbtQCOB9Yg3sK1ms8YymxuIspltkKnANgjPkVWAtM91S/RUS6lM0BIyLNgExjTGlNnZBSZ6MJRanAWAxsAjYC3wAPeC5xLcI9B0oyMBv3TIA5nmM+5eQEczvQCtglIknAHE7MlXIRUOuq36q6TasNK1XDRKShMSbP08tYAww3xqR75qv41rNe0WB82Wd8ADxkjNleAyEr5RO9y0upmveJZ9KjMOAJT88FY0yhiPwd95zy+ys62DMR14eaTFSw0R6KUkopv9AxFKWUUn6hCUUppZRfaEJRSinlF5pQlFJK+YUmFKWUUn6hCUUppZRf/H/k3xOHG4OHnwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# plot CV误差曲线\n",
    "test_means = grid.cv_results_[ 'mean_test_score' ]\n",
    "test_stds = grid.cv_results_[ 'std_test_score' ]\n",
    "train_means = grid.cv_results_[ 'mean_train_score' ]\n",
    "train_stds = grid.cv_results_[ 'std_train_score' ]\n",
    "\n",
    "\n",
    "# plot results\n",
    "n_Cs = len(Cs)\n",
    "number_penaltys = len(penaltys)\n",
    "test_scores = np.array(test_means).reshape(n_Cs,number_penaltys)\n",
    "train_scores = np.array(train_means).reshape(n_Cs,number_penaltys)\n",
    "test_stds = np.array(test_stds).reshape(n_Cs,number_penaltys)\n",
    "train_stds = np.array(train_stds).reshape(n_Cs,number_penaltys)\n",
    "\n",
    "x_axis = np.log10(Cs)\n",
    "for i, value in enumerate(penaltys):\n",
    "    #pyplot.plot(log(Cs), test_scores[i], label= 'penalty:'   + str(value))\n",
    "    pyplot.errorbar(x_axis, test_scores[:,i], yerr=test_stds[:,i] ,label = penaltys[i] +' Test')\n",
    "    pyplot.errorbar(x_axis, train_scores[:,i], yerr=train_stds[:,i] ,label = penaltys[i] +' Train')\n",
    "    \n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'log(C)' )                                                                                                      \n",
    "pyplot.ylabel( 'neg-logloss' )\n",
    "pyplot.savefig('LogisticGridSearchCV_C.png' )\n",
    "\n",
    "pyplot.show()\n",
    "\n",
    "#下图给出了L1正则和L2正则下、不同正则参数C对应的模型在训练集上测试集上的正确率（score）。\n",
    "#可以看出在训练集上C越大（正则越少）的模型性能越好；但在测试集上当C=1时性能最好（L1正则和L2正则均是）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "线性SVM正则参数调优\n",
    "线性SVM LinearSVC的需要调整正则超参数包括C（正则系数，一般在log域（取log后的值）均匀设置候选参数）和正则函数penalty（L2/L1）\n",
    "采用交叉验证，网格搜索步骤与Logistic回归正则参数处理类似，在此略。\n",
    "这里我们用校验集（X_val、Y_val）来估计模型性能"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1502,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.402597402597\n",
      "accuracy: 0.350649350649\n",
      "accuracy: 0.38961038961\n",
      "accuracy: 0.435064935065\n",
      "accuracy: 0.642857142857\n",
      "accuracy: 0.350649350649\n",
      "accuracy: 0.357142857143\n",
      "accuracy: 0.357142857143\n",
      "accuracy: 0.363636363636\n",
      "accuracy: 0.435064935065\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XmYXHWV//H3yZ6QsGRjyEYnJizpEgg0IRhEdqIOQUQUcBAcIYMS0Z+MIzw6KGGeGQbUcUOQURwUZFEQIkQiAloVCJCOiYEkhOzQBEynE0AgWyfn98f3Fql0Ol3V3XX71vJ5PU8/VXXr3lvnZqnT93u+i7k7IiIibemWdAAiIlL6lCxERCQvJQsREclLyUJERPJSshARkbyULEREJC8lCxERyUvJQkRE8lKyEBGRvHokHUCxDB482GtqapIOQ0SkrMyfP3+Duw/Jt1/FJIuamhrq6+uTDkNEpKyY2dpC9ou1GcrMppjZMjNbYWZX72WfT5rZEjNbbGa/ytm+w8wWRj8z44xTRETaFtudhZl1B24GTgcagHlmNtPdl+TsMw64Bpjs7pvMbGjOKTa7+1FxxSciIoWL885iIrDC3Ve5+zbgHuDsFvtcBtzs7psA3H19jPGIiEgHxVmzGA68kvO6ATiuxT6HAJjZU0B34Fvu/mj0Xh8zqweagRvc/cGWH2Bm04BpAKNG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mMIQWs0sXQs1QIh2zt2V121pudzNhTh8I8/ccmaco2RvY0oHYpIxYuAX4GbDU3b/b4r0pwNcIc0K9m7O9n5ntEz0/HWh29yWEusZkMxubs98h0fNLgTOBC7JNn+2hZCHSMWngU2bW3cyGACcSioZzgHOj2sWBwEk5xywFxkKYHpvQhHBd9GWBmY0zs7Oj54OARg8L9UiZMrNzzKyBMP39I2Y2O9o+zMxmRbtNJtQQTrFd62d/JHrvR8AA4LFo+63R9qHAX8xsKSGZXATg7o2EjhJ3m9kiQvI4LDrmVuBAYG50rmvbdS2aSFCkcGb2trv3j77gbwQ+TJid9z/c/d7oTuHHhOTxEuHu4Lvu/piZXQQc6u7fiM61L2FVvlMIa0o0AV9193lRUfx4d7+qq69RpDVKFiJFZmb93f3t6O7gOWCyu79uZn2BJ6PXeytsZ8/xAGGN5Da7XYp0FRW4RYrv4WikbS/gend/HcDdN0cFxuHAy3s72Mx6AQ8qUUgp0Z2FiIjkpQK3iIjkpWQhIiJ5KVmIiEheShYiIpKXkoWIiOSlZCEiInn9f7u4muMZSZFQAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "def fit_grid_point_Linear(C, X_train, y_train, X_val, Y_val):\n",
    "    \n",
    "    # 在训练集是那个利用SVC训练\n",
    "    SVC2 =  LinearSVC( C = C)\n",
    "    SVC2 = SVC2.fit(X_train, Y_train)\n",
    "    \n",
    "    # 在校验集上返回accuracy\n",
    "    accuracy = SVC2.score(X_val, Y_val)\n",
    "    \n",
    "    print(\"accuracy: {}\".format(accuracy))\n",
    "    return accuracy\n",
    "\n",
    "#需要调优的参数\n",
    "C_s = np.logspace(122.92, 122.93, 10)# logspace(a,b,N)把10的a次方到10的b次方区间分成N份  \n",
    "#penalty_s = ['l1','l2']\n",
    "\n",
    "accuracy_s = []\n",
    "for i, oneC in enumerate(C_s):\n",
    "#    for j, penalty in enumerate(penalty_s):\n",
    "    tmp = fit_grid_point_Linear(oneC, X_train, Y_train, X_test, Y_test)\n",
    "    accuracy_s.append(tmp)\n",
    "\n",
    "x_axis = np.log10(C_s)\n",
    "#for j, penalty in enumerate(penalty_s):\n",
    "pyplot.plot(x_axis, np.array(accuracy_s), 'b-')\n",
    "    \n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'log(C)' )                                                                                                      \n",
    "pyplot.ylabel( 'accuracy' )\n",
    "pyplot.savefig('SVM_Otto.png' )\n",
    "\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "RBF核SVM正则参数调优\n",
    "RBF核是SVM最常用的核函数。 RBF核SVM 的需要调整正则超参数包括C（正则系数，一般在log域（取log后的值）均匀设置候选参数）和核函数的宽度gamma C越小，决策边界越平滑； gamma越小，决策边界越平滑。\n",
    "采用交叉验证，网格搜索步骤与Logistic回归正则参数处理类似，在此略。\n",
    "这里我们用校验集（X_val、y_val）来估计模型性能"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1498,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.svm import SVC\n",
    "\n",
    "def fit_grid_point_RBF(C, gamma, x_train, y_train, x_val, y_val):\n",
    "    \n",
    "    # 在训练集是那个利用SVC训练\n",
    "    SVC3 =  SVC( C = C, kernel='rbf', gamma = gamma)\n",
    "    SVC3 = SVC3.fit(x_train, y_train)\n",
    "    \n",
    "    # 在校验集上返回accuracy\n",
    "    accuracy = SVC3.score(x_val, y_val)\n",
    "    \n",
    "    print(\"accuracy: {}\".format(accuracy))\n",
    "    return accuracy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1499,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.350649350649\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n"
     ]
    }
   ],
   "source": [
    "#需要调优的参数\n",
    "C_s = np.logspace(-2, 2, 5)# logspace(a,b,N)把10的a次方到10的b次方区间分成N份 \n",
    "gamma_s = np.logspace(-2, 2, 5)  \n",
    "\n",
    "accuracy_s = []\n",
    "for i, oneC in enumerate(C_s):\n",
    "    for j, gamma in enumerate(gamma_s):\n",
    "        tmp = fit_grid_point_RBF(oneC, gamma, X_train, Y_train, X_test, Y_test)\n",
    "        accuracy_s.append(tmp)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从上述部分运行结果来看，gamma参数设置不合适（gamma越大，对应RBF核的sigma越小，决策边界更复杂，可能发生了过拟合） 所以调小gamma值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1514,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.649350649351\n",
      "accuracy: 0.694805194805\n",
      "accuracy: 0.662337662338\n",
      "accuracy: 0.655844155844\n",
      "accuracy: 0.636363636364\n",
      "accuracy: 0.636363636364\n",
      "accuracy: 0.616883116883\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzs3XlclVX+wPHPYRMUBUVcERF3QEVE3MotK83UaszULHVK22wff+3lWJZltszUNNOmZqk15ZbZok6ZY264K26AqLihqCgq6/3+/rjXO4go6+Ve4Pt+vXjJfe65z/N94Hq/nPM853uMiKCUUkpdi5uzA1BKKeX6NFkopZQqlCYLpZRShdJkoZRSqlCaLJRSShVKk4VSSqlCabJQSilVKE0WSimlCqXJQimlVKE8nB1AWalbt66EhIQ4OwyllKpQNm7ceFJEAgtrV2mSRUhICLGxsc4OQymlKhRjzIGitNNhKKWUUoXSZKGUUqpQmiyUUkoVqtJcsyhIdnY2ycnJZGRkODsUVQV4e3sTFBSEp6ens0NRqsxV6mSRnJxMzZo1CQkJwRjj7HBUJSYipKamkpycTLNmzZwdjlJlrlIPQ2VkZBAQEKCJQjmcMYaAgADtxapKq1InC0AThSo3+l5TlVmlTxZKKVWZ/bj9KIu2HHb4cTRZlJMuXboQGRlJcHAwgYGBREZGEhkZSVJSUrH2M3/+fHbv3l3s41933XVs2bKl2K+75O2332bOnDklfn15uPPOO0lMTLzq81u2bKFr166Eh4fTrl07srOzr2jz4osv0rhxY/vv5+eff3ZkyEqVSmzSKR7/eguz1xwg1yIOPValvsDtStatWwfAzJkziY2N5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uzP9elSxfq16+Pt7c3oaGh3HzzzQC0a9fush7SoEGD7NsbNWpEWFgYbm5uhIWF2dvNnTuXqKgooqKi2LVr12XHqVevHkeOHLnivHNycli9ejVz585l1apVfP3116xcufKKdo8++ijx8fFs2bKFgIAAJk6cWNwfsVIOk5NrYcKczew4nMYHIzvSoYl/uR27yvQsStsDcBQRoX///syePfuK52JjY1m2bBnz5s3jo48+4pdffrnqfvJ+gN9xxx28/PLLVz1ecbYD+Pj42OcPXKvd9OnTadKkCV9++SXZ2dn4+vran6tWrZr9ezc3N/tjNzc3cnJyrmiXt03edvv27eP9999n/fr1+Pv7M2rUqMvmNmRkZODj48O3337La6+9BlivEwUFBdG7d28CAgIAGDBgAJs2baJXr16XnUP9+vXt348bN+6ypKmUM4kILy3ayX92p/DabRHc0LZ+4S8qQ9qzcLLu3buzcuVK+10858+fZ9++fZw7d46zZ89y66238u6777J582YAatasyblz567Yj5eXF1u2bGHLli1XTRQAXbt25ddffyU1NZWcnBzmzZtHr1696NKlC7/++itnzpwhOzub+fPn21/Ttm1b4uPjAQgMDMTT09NeDn7evHn2dmlpaTRs2BBjDLNmzbpmYimps2fPUrNmTWrVqsXRo0evuFtp3759hIeHM3ToUPvPIzIykgEDBrB582YuXrxITk4Ov//+O2FhYVfs/+jRo/bvFyxYQERERJmfg1Il8Y/fEpi7/iAP927OqK5Ny/34VaZn4arq16/PZ599xl133UVWVhYAr7/+Oj4+Ptxxxx1kZmZisVh45513ABgxYgQPPPAA06dPZ+HChRR3waegoCAmT55M7969EREGDRrEwIEDAesF9ZiYGBo3bkx4eLh9rP6WW2657ALz559/ztixY6lZsyY9e/a0t5swYQJDhw5l7ty59OvX77KeQVmJiooiLCyMiIgIQkND6dGjh/25I0eO4OfnZx8yyysgIIDHHnuMTp064ebmxqBBg+xDYWPHjuXxxx8nMjKSp59+mu3bt2OMITQ0lH/+859lfg5KFdeCzclM+3kPt0U2YuLNrZ0Sg3HEX3/OEB0dLfkXP9q1axdt27Z1UkQVT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03fuAb4nTW40TdJc0rSdNSPAPQCR5hLZB7xeN+rpgKQn83IfcDoiLnarQmbNOFmYteZT0uifB4GdwEu522kzaXTTQ8A60kxmZ/M22/lv8nieNKnVEUnDpPktanMPPAYMdbYKZuV51FmzNpM0O9LMa32ks43BiDgp6TrSNYzBJhe2a/vYArwcxfPEm3WF74Yya79tkuYAM4A38xkHEXFe0mukOZF/abRxnjhpqxOF9RKfWZiZWSFfszAzs0JOFmZmVsjJwszMCjlZmJlZIScLMzMr5GRhZmaF/gEAC/48V+d8TgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#需要调优的参数C_s和gamma_s\n",
    "C_s = np.logspace(-1, 2, 4)# logspace(a,b,N)把10的a次方到10的b次方区间分成N份 \n",
    "gamma_s = np.logspace(-6.5, -6.45, 6)  \n",
    "\n",
    "accuracy_s = []\n",
    "for i, oneC in enumerate(C_s):\n",
    "    for j, gamma in enumerate(gamma_s):\n",
    "        tmp = fit_grid_point_RBF(oneC, gamma, X_train, Y_train, X_test, Y_test)\n",
    "        accuracy_s.append(tmp)\n",
    "        \n",
    "        \n",
    "        \n",
    "accuracy_s1 =np.array(accuracy_s).reshape(len(C_s),len(gamma_s))\n",
    "x_axis = np.log10(C_s)\n",
    "for j, gamma in enumerate(gamma_s):\n",
    "    pyplot.plot(x_axis, np.array(accuracy_s1[:,j]), label = ' Test - log(gamma)' + str(np.log10(gamma)))\n",
    "\n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'log(C)' )                                                                                                      \n",
    "pyplot.ylabel( 'accuracy' )\n",
    "pyplot.savefig('RBF_SVM_Otto.png' )\n",
    "\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "发现：SVM相比logistic分类效果很难保证,对参数很敏感；\n",
    "原因猜测：SVM只考虑support vectors，也就是和分类最相关的少数点，去学习分类器，在点的权重和间隔之间衡量得失，参数对支持向量和间隔的影响较大。而logistic回归通过非线性映射，大大减小离分类平面较远的点的权重，相对提升与分类最相关的数据点的权重，对参数相对没那么敏感。 "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
